<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="../js/jquery-1.8.3.js"></script>
    <style>
        table,tr,td,th{
            border:1px solid black;
            border-collapse: collapse;
        }
    </style>
    <script type="text/javascript">
        $(function(){
            //设置点击弹出内容
            $("p").each(function(){
                $(this).click(function(){
                    alert($(this).text());
                });
            });
            //设置隔行变色
            $("tr:even").css({background:"blue"});
            $("tr:odd").css({background:"yellow"});
            $("tr").eq(0).css({background:"red"});

            //设置点击弹出选中数量
            $(".button").click(function(){
                alert($("input[type='checkbox']:checked").length);
            });



        });
    </script>
</head>
<body>
<p>test1</p>
<p>test2</p>
<table>
    <tr>
        <th>2</th>
        <th>2</th>
        <th>2</th>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
</table>
<button class="button">点击</button>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
<input type="checkbox"/>
</body>
</html>